<?xml version="1.0"?>

<!-- gjdoc-common.rng
     Copyright (C) 2003 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. -->

<grammar 
      xmlns="http://relaxng.org/ns/structure/1.0" 
      xmlns:a="http://relaxng.org/ns/annotation/1.0" 
      xmlns:gjdoc="http://www.gnu.org/software/cp-tools/gjdocxml">
   
   <a:documentation>
      A Relax NG grammar with definitions of elements and attributes
      used by both the XML index file and the XML class files
      generated by GNU Gjdoc.
   </a:documentation>

   <define name="firstSentenceTags-element">
      <a:documentation>

      </a:documentation>

      <element name="gjdoc:firstSentenceTags">
	 <ref name="tags-contents"/>
      </element>
   </define>

   <define name="inlineTags-element">
      <a:documentation>

      </a:documentation>

      <element name="gjdoc:inlineTags">
	 <ref name="tags-contents"/>
      </element>
   </define>

   <define name="seeTags-element">
      <a:documentation>

      </a:documentation>

      <element name="gjdoc:seeTags">
	 <ref name="tags-contents"/>
      </element>
   </define>


   <define name="tags-element">
      <a:documentation>

      </a:documentation>

      <element name="gjdoc:tags">
	 <ref name="tags-contents"/>
      </element>
   </define>

   <define name="tags-contents">
      <a:documentation>
	 Specifies mixed content comprised of gjdoc tags,
	 HTML tags, taglet output, and text.
      </a:documentation>

      <zeroOrMore>
	 <ref name="TagContent"/>
      </zeroOrMore>
   </define>

   <define name="implements-element">
      <element name="gjdoc:implements">
	 <a:documentation>
	    Specifies an interface that the class implements.
	 </a:documentation>
	 
	 <ref name="typedef-attributes"/>
      </element>
   </define>


   <define name="superimplements-element">
      <element name="gjdoc:superimplements">
	 <a:documentation>
	    Specifies an interface implemented by superclasses
	    (ancestors) of the class. Together with the interfaces
	    specified with tag `implements', this lists all interfaces
	    the class can be cast to.
	 </a:documentation>
	 
	 <ref name="typedef-attributes"/>
      </element>
   </define>

   <define name="typedef-attributes">
      <attribute name="typename">
	 <a:documentation>
	    The name of the class, without package prefix. If the
	    class is an inner class, this includes the name of its
	    outer class.
	 </a:documentation>

	 <text/>
      </attribute>
      
      <ref name="qualifiedtypename-attribute"/>

      <optional>
	 <attribute name="dimension">
	    <a:documentation>
	       The dimension of this typedef, represented by a zero or
	       more repetitions of the string "[]".
	    </a:documentation>

	    <text/>
	 </attribute>
      </optional>
   </define>

   <define name="name-attribute">
      <attribute name="name">
	 <a:documentation>
	    The name of some Java Entity (package, class, constructor,
	    method, field.)
	 </a:documentation>

	 <text/>
      </attribute>
   </define>

   <define name="qualifiedtypename-attribute">
      <attribute name="qualifiedtypename">
	 <a:documentation>
	    The fully qualified name of the class.
	 </a:documentation>

	 <text/>
      </attribute>
   </define>

   <define name="superclass-element">
      <element name="gjdoc:superclass">
	 <a:documentation>
	    Specifies the superclass of the class.
	 </a:documentation>
	 
	 <ref name="typedef-attributes"/>
      </element>
   </define>

   <define name="tag-element">
      <element name="gjdoc:tag">
	 <ref name="name-attribute"/>
	 <attribute name="kind">
	    <text/>
	 </attribute>
	 <zeroOrMore>
	    <ref name="TagContent"/>
	 </zeroOrMore>
      </element>
   </define>

   <define name="exception-element">
      <element name="gjdoc:exception">
	 <ref name="typedef-attributes"/>
      </element>
   </define>

   <define name="TagContent">
      <choice>
	 <element>
	    <anyName>
	       <except>
		  <nsName ns="gjdoc"/>
		  <name>gjdoc:tag</name>
	       </except>
	    </anyName>
	    <zeroOrMore>
	       <attribute>
		  <anyName/>
	       </attribute>
	    </zeroOrMore>
	    <zeroOrMore>
	       <choice>
		  <text/>
		  <ref name="TagContent"/>
	       </choice>
	    </zeroOrMore>
	 </element>
	 <ref name="tag-element"/>
	 <ref name="exception-element"/>
	 <ref name="tagletText-element"/>
	 <text/>
      </choice>
   </define>

   <define name="containingPackage-element">
      <element name="gjdoc:containingPackage">
	 <a:documentation>
	    The full name of the package containing the class.
	 </a:documentation>
	 <attribute name="name">
	    <text/>
	 </attribute>
      </element>
   </define>

   <define name="tagletText-element">
      <element name="gjdoc:tagletText">
	 <a:documentation>
	    A string generated by a Taglet.toString() method.
	 </a:documentation>
	 <attribute name="tagName">
            <a:documentation>
               The name of the tag this Taglet was assigned to.
            </a:documentation>
	    <text/>
	 </attribute>
      </element>
   </define>

   <define name="isError-element">
      <element name="gjdoc:isError">
	 <a:documentation>
	    Exists when the described class is a subclass of
	    java.lang.Error.
	 </a:documentation>
      </element>
   </define>

   <define name="isException-element">
      <element name="gjdoc:isException">
	 <a:documentation>
	    Exists when the described class is a subclass of
	    java.lang.Exception.
	 </a:documentation>
      </element>
   </define>

   <define name="isInterface-element">
      <element name="gjdoc:isInterface">
	 <a:documentation>
	    Exists when the described class is an interface.
	 </a:documentation>
      </element>
   </define>

</grammar>

